import request from '@/utils/request';
export const  reqspudatalist = (page,limit,category3Id)=>request({
    url:`/admin/product/${page}/${limit}`,
    method:'get',
    params: {category3Id}
})
export const reqSpu = (spuId)=>request({
    url:`/admin/product/getSpuById/${spuId}`,
    method:"get"
})
export const reqTradeMarkList =()=>request({
    url:`/admin/product/baseTrademark/getTrademarkList`,
    method:"get"
})
export const reqSpuImageList = (spuId)=>request({
    url:`/admin/product/spuImageList/${spuId}`,
    method:"get"
})
export const reqBaseSaleAttrList = ()=>request({
    url:`/admin/product//baseSaleAttrList`,
    method:"get"
})
//保存按钮发起请求:
export const reqsavespu = (spuInfo)=>{
    if(spuInfo.id){//修改
        return request({
            url:`/admin/product/updateSpuInfo`,
            method:"post",
            data:spuInfo
        })
    }else{//增加
        return request({
            url:`/admin/product/saveSpuInfo`,
            method:"post",
            data:spuInfo
        })
    }
}
//删除接口:
export const reqdeletedata = (spuId)=>request({
    url:`/admin/product/deleteSpu/${spuId}`,
    method:"DELETE"
})
